package com.zjhcsoft.auth.gateway.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NacosGatewayConfig {

  public static final long DEFAULT_TIMEOUT = 30000;

  /**
   * nacos地址
   */
  private String nacosServerAddr;
  /**
   * nacos命名空间
   */
  private String nacosNamespace;
  /**
   * nacos data id
   */
  private String nacosRouteDataId;
  /**
   * nacos group
   */
  private String nacosRouteGroup;

  @Value("${spring.cloud.nacos.discovery.server-addr}")
  public void setNacosServerAddr(String nacosServerAddr) {
    this.nacosServerAddr = nacosServerAddr;
  }

  @Value("${spring.cloud.nacos.discovery.namespace}")
  public void setNacosNamespace(String nacosNamespace) {
    this.nacosNamespace = nacosNamespace;
  }

  @Value("${nacos.gateway.route.config.data-id}")
  public void setNacosRouteDataId(String nacosRouteDataId) {
    this.nacosRouteDataId = nacosRouteDataId;
  }

  @Value("${nacos.gateway.route.config.group}")
  public void setNacosRouteGroup(String nacosRouteGroup) {
    this.nacosRouteGroup = nacosRouteGroup;
  }

  public String getNacosNamespace() {
    return nacosNamespace;
  }

  public String getNacosRouteDataId() {
    return nacosRouteDataId;
  }

  public String getNacosRouteGroup() {
    return nacosRouteGroup;
  }

  public String getNacosServerAddr() {
    return nacosServerAddr;
  }
}
